//
//  ThemeStyleCollectionCell.m
//  LingQian
//
//  Created by xieyingze on 2018/1/22.
//  Copyright © 2018年 xieyingze. All rights reserved.
//

#import "ThemeStyleCollectionCell.h"

@interface ThemeStyleCollectionCell()
@property (nonatomic, strong) UIView *mainView;
@property (nonatomic, strong) BaseImageView *themeImageView;
@property (nonatomic, strong) NSArray *dataSource;
@end

@implementation ThemeStyleCollectionCell

#pragma mark - init

- (void)initSubView {
    self.backgroundColor = kCOLOR_clear;
    [self addSubview:self.mainView];
}

- (void)autoLayoutSubviews {
    [self.mainView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(@0).insets(UIEdgeInsetsMake(10, 10, 10, 10));
    }];
}

#pragma mark - method


#pragma makr - Event


#pragma mark - Setter

- (void)setIndexPath:(NSIndexPath *)indexPath {
    _indexPath = indexPath;
    self.themeImageView.imageName = [NSString stringWithFormat:@"unity_themeStyle%ld",(long)indexPath.row+1];
}

#pragma mark - Getter

- (UIView *)mainView {
    if (!_mainView) {
        _mainView = [UIView new];
        _mainView.backgroundColor = kCOLOR_white;
        [_mainView setViewShadow:kCOLOR_shadow offset:CGSizeMake(0, 0) radius:kUI_ShawRadius/2];
        
        BaseImageView *themeImageView = [BaseImageView new];
        themeImageView.imageName = @"unity_themeStyle1";
        self.themeImageView = themeImageView;
        [_mainView addSubview:themeImageView];
        [themeImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.edges.equalTo(@0);
        }];
    }
    return _mainView;
}

@end
